//my-tabbar文件
<template>
	<view>
		<u-tabbar
			class="tabbar"
			:value="currentTab"
			:fixed="true"
			:border="true"
			activeColor="rgba(255, 125, 190, 1)"
			:placeholder="true"
			z-index="999"
			 @change="changeTabIndex"
		>
			<u-tabbar-item 
			v-for="item in switchTabs"
			:key="item.name"  
			:text="item.text" :icon="item.iconName" ></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		data(){
			return{
				switchTabs:[
					{
						"pagePath":"/pages/index/index",
						"iconName":"home",
						"text":"首页",
						"name":"index",
						
					},
					{
						"pagePath":"/pages/ranking/ranking",
						"iconName":"list",
						"text":"排行榜",
						"name":"ranking"
					},
					{
						"pagePath":"/pages/",
						"iconName":"plus-square-fill",
						"text":"",
						"name":""
					},
					{
						"pagePath":"/pages/birthday/birthday",
						"iconName":"gift",
						"text":"生日",
						"name":"birthday"
					},
					{
						"pagePath":"/pages/mine/mine",
						"iconName":"account",
						"text":"我的",
						"name":"mine"
					}
				]
			}
		},
		props:['currentTab'],
		methods:{
			changeTabIndex(e){
				let pagePath = this.switchTabs[e].pagePath
				uni.switchTab({
					url:pagePath
				})
			}
		}
	}
</script>
<style lang="scss">

</style>
